Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-3349] [SQL] Output partitioning of limit should not be inherited from child #2262

Closed
wants to merge 2 commits into from

Conversation

ericl
Copy link
Contributor

@ericl ericl commented Sep 4, 2014

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@ericl ericl changed the title [SPARK-3349] Output partitioning of limit should not be inherited from child [SPARK-3349] [SQL] Output partitioning of limit should not be inherited from child Sep 4, 2014
@marmbrus
Copy link
Contributor

marmbrus commented Sep 4, 2014

add to whitelist

@SparkQA
Copy link

SparkQA commented Sep 4, 2014

QA tests have started for PR 2262 at commit ac32723.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 4, 2014

QA tests have finished for PR 2262 at commit ac32723.

  • This patch passes unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class BlockManagerMaster(
    • class AttributeMap[A](baseMap: Map[ExprId, (Attribute, A)])

@@ -97,6 +97,7 @@ case class Limit(limit: Int, child: SparkPlan)
// partition local limit -> exchange into one partition -> partition local limit again

override def output = child.output
override def outputPartitioning = SinglePartition
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SinglePartition for LIMIT may cause performance issue for large number of records(in multiple partitions), do we really need to change this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not changing the implementation, just correcting a bug that
prevents exchange operators from being inserted when we need them.
On Sep 3, 2014 11:00 PM, "Cheng Hao" notifications@github.com wrote:

In
sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala:

@@ -97,6 +97,7 @@ case class Limit(limit: Int, child: SparkPlan)
// partition local limit -> exchange into one partition -> partition local limit again

override def output = child.output

  • override def outputPartitioning = SinglePartition

SinglePartition for LIMIT may cause performance issue for large number of
records(in multiple partitions), do we really need to change this?


Reply to this email directly or view it on GitHub
https://github.com/apache/spark/pull/2262/files#r17096863.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, understood, thanks for explanation.

@ericl
Copy link
Contributor Author

ericl commented Sep 4, 2014

added regression test

@marmbrus
Copy link
Contributor

marmbrus commented Sep 5, 2014

test this please

@rxin
Copy link
Contributor

rxin commented Sep 6, 2014

Jenkins, test this please.

@SparkQA
Copy link

SparkQA commented Sep 6, 2014

QA tests have started for PR 2262 at commit 3e1b05c.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 6, 2014

QA tests have finished for PR 2262 at commit 3e1b05c.

  • This patch fails unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@marmbrus
Copy link
Contributor

marmbrus commented Sep 8, 2014

Jenkins, test this please

@marmbrus
Copy link
Contributor

marmbrus commented Sep 8, 2014

This passed tests before and I ran the new regression test by hand. I'm going to merge this into master.

Thanks Eric!

@asfgit asfgit closed this in 7db5339 Sep 8, 2014
asfgit pushed a commit that referenced this pull request Sep 20, 2014
**This PR introduces a subtle change in semantics for HiveContext when using the results in Python or Scala.  Specifically, while resolution remains case insensitive, it is now case preserving.**

_This PR is a follow up to #2293 (and to a lesser extent #2262 #2334)._

In #2293 the catalog was changed to store analyzed logical plans instead of unresolved ones.  While this change fixed the reported bug (which was caused by yet another instance of us forgetting to put in a `LowerCaseSchema` operator) it had the consequence of breaking assumptions made by `MultiInstanceRelation`.  Specifically, we can't replace swap out leaf operators in a tree without rewriting changed expression ids (which happens when you self join the same RDD that has been registered as a temp table).

In this PR, I instead remove the need to insert `LowerCaseSchema` operators at all, by moving the concern of matching up identifiers completely into analysis.  Doing so allows the test cases from both #2293 and #2262 to pass at the same time (and likely fixes a slew of other "unknown unknown" bugs).

While it is rolled back in this PR, storing the analyzed plan might actually be a good idea.  For instance, it is kind of confusing if you register a temporary table, change the case sensitivity of resolution and now you can't query that table anymore.  This can be addressed in a follow up PR.

Follow-ups:
 - Configurable case sensitivity
 - Consider storing analyzed plans for temp tables

Author: Michael Armbrust <michael@databricks.com>

Closes #2382 from marmbrus/lowercase and squashes the following commits:

c21171e [Michael Armbrust] Ensure the resolver is used for field lookups and ensure that case insensitive resolution is still case preserving.
d4320f1 [Michael Armbrust] Merge remote-tracking branch 'origin/master' into lowercase
2de881e [Michael Armbrust] Address comments.
219805a [Michael Armbrust] style
5b93711 [Michael Armbrust] Replace LowerCaseSchema with Resolver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants